<template>
	<view style="background-color: white;border-radius: 10rpx;padding: 30rpx;margin-bottom: 20rpx;" @click="detail(item)"
		v-for="item in list">
		<view class="" style="display: flex;justify-content: space-between;align-items: center;">
			<view class="">
				订单编号：{{item.order_no}}
			</view>
			<view class="" style="color: #F00505;" v-if="item.state == '1'">
				待支付
			</view>
			<view class="" style="color: #707070;" v-if="item.state == '2'">
				已支付
			</view>
			<view class="" style="color: #707070;" v-if="item.state == '3'">
				已退款
			</view>
			<!-- <view class="" style="color: #707070;">
				已退款
			</view> -->
		</view>
		<view class="" style="margin-top: 26rpx;display: flex;">
			<view class="" style="width: 256rpx;height: 152rpx;border-radius: 10rpx;">
				<image :src="item.cover" style="width: 256rpx;height: 152rpx;border-radius: 10rpx;" mode="aspectFill">
				</image>
			</view>
			<view class=""
				style="margin-left: 30rpx;height: 152rpx;display: flex;flex-direction: column;justify-content: space-between;">
				<view class="" style="display: flex;align-items: center;justify-content: space-between;width: 350rpx;">
					<view class="" style="font-size: 36rpx;font-weight: bold;">
						<span v-if="type == 1">七天速成</span>
						<span v-if="type == 2">城市巡回</span>
					</view>
					<view class="" style="font-size: 32rpx;">
						<span style="font-size: 20rpx;">¥</span>{{item.pay_price}}
					</view>
				</view>
				<view class="" style="display: flex;align-items: center;">
					<image src="/static/image/time.png" style="width: 24rpx;height: 24rpx;" mode=""></image>
					<view class="" style="margin-left: 10rpx;color: #717171;">
						<span v-if="type == 1">{{item.stage_name}}</span>
						<span v-if="type == 2" style="font-size: 26rpx;">{{item.start_time}}-{{item.end_time}}</span>
					</view>
				</view>
				<view class="" style="display: flex;align-items: center;margin-left: -4rpx;">
					<image src="/static/image/place.png" style="width: 32rpx;height: 32rpx;" mode=""></image>
					<view class=""
						style="margin-left: 10rpx;color: #717171;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;width: 310rpx;">
						{{item.province}}{{item.city}}{{item.address}}
					</view>
				</view>
			</view>
		</view>
		<view class="" v-if="item.time" style="margin-top: 40rpx;display: flex;justify-content: space-between;align-items: center;">
			<view class="" style="color: #F00505;">
				<!-- 9分59秒后关闭 -->
			</view>
			<view class="" @click.stop="pay(item)"
				style="width: 156rpx;height: 60rpx;border-radius: 10rpx;background-color: #5062A7;display: flex;justify-content: center;align-items: center;color: white;">
				去支付
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import tools from '@/utils/tools'
	import {watchEffect,ref} from 'vue'
	const props = defineProps({
		list: { type: Array as any },
		type: { type: Number} //1是七天速成2是城市巡回
	})
 
	watchEffect(()=>{
		if(props.type){
 
			console.log(props.type);
		}
	})	
	const pay = (item) => {
		//七天速成
		// if (props.type == 1) {
		// 	tools.navTo('pagesb/order/pay?id=' + item.id + '&type' + props.type);
		// }
		tools.navTo('/pagesB/order/pay?id=' + item.id + '&type=' + props.type);
		console.log(232);
	}
	const detail = (item : any) => {
		//七天速成
		console.log(props.type);
		uni.navigateTo({
			url: '/pagesB/mine/mineTrain/detail?id=' + item.id + '&type=' + props.type
		})
		// if(props.type == 0){
		// 	uni.navigateTo({
		// 	url: '/pagesB/mine/mineTrain/detail?id=' + item.id
		// })
		// }
		
		//课程详情
		// uni.navigateTo({
		// 	url:'/pagesB/mine/mineStudent/studentDetail'
		// })
	}
</script>

<style>
</style>